package cn.wyu.web;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/checkRegisterServlet")
public class checkRegisterServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
//        request.setAttribute("data","123");
//        TODO 怎么发送数据给前端呢？？？？？
//        PrintWriter writer = response.getWriter();
//        String respJson = "[{\"resp\":true}]";
////        writer.write(respJson);
//        writer.print(true);
//        writer.flush();
//        writer.close();
        System.out.println(username);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
